package linker.list;

import linker.account.Account; 

/**
 * 
 * @version linker 0.93
 * @author Jianfeng jianfeng.linker@gmail.com
 * 
 */
public class MessageList extends Model {
	// @_@
	private static final long serialVersionUID = 1L; 

	public void addMessage(ListItem messageItem) {
		if (!contains(messageItem))
			addElement(messageItem);

		Account.setStatus();
	}

	public void addOneMessage(ListItem messageItem) {
		for (int i = 0; i < size(); i++)
			if (get(i).getClass().equals(messageItem.getClass())) {
				remove(i);
				insertElementAt(messageItem, i);
				
				return;
			}

		addElement(messageItem);
	}

	public void removeMessage(ListItem message) {
		removeElement(message);
	}
 
}
